package ro.dta.idbi.model;

import java.util.Hashtable;
import java.util.regex.Matcher;

import ro.dta.idbi.interfaces.IPrimitiveParser;

/**
 * Column construct parser for the add,extend,delete and contract BAV
 * transformations
 * 
 * @author Tudor Dobrila
 * 
 */
public class AddColumnParser implements IPrimitiveParser {

	@Override
	public Hashtable<String, Object> parse(Matcher matcher) {
		Hashtable<String, Object> result = new Hashtable<String, Object>();
		result.put("type", "column");
		result.put("table", matcher.group(1));
		result.put("name", matcher.group(2));
		result.put("nullable", matcher.group(3));
		result.put("coltype", matcher.group(4));
		result.put("iql", matcher.group(5));
		return result;
	}

}
